Software programs can be perfectly reproduced in an infinite number of copies. This is a major concern for publishers of the programs wishing to protect their intellectual property rights; indeed, the publishers typically receive a royalty for a licensed use of each program, so that any unaccounted use or distribution of the program results in unpaid royalties. The problem has been exacerbated in the last years by the widespread diffusion of the Internet, which further facilitates the uncontrolled distribution of this kind of products.
The most straightforward way of avoiding unaccounted usage of the programs is that of preventing unauthorized copying and transmission. For example, some programs embed control code that limits the number of copies that can be made or disables operation of the programs after a predetermined period of time has lapsed. Another technique consists of requiring possession of a software or hardware key for running the programs.
A different solution proposed in the art, known as technical licensing, consists of modifying each program to include a call to a licensing management system. Every time the program is started, a corresponding request is transferred to the licensing management system. The licensing management system verifies whether the running of the program is authorized. If the result of the verification is positive, the program can continue its execution; otherwise, the program is forced to stop.
However, the solutions described above require each program to be modified by the publisher, so that they are not of general applicability. In addition, the solutions known in the art are quite rigid and cannot be readily adapted to different requirements.
A different approach is based on an agent running in the background. The agent periodically checks the programs that are in execution. The result of the verification is logged, in order to generate program usage reports. Moreover, if a program is running violating its authorized conditions of use the agent may kill the respective process (so as to stop execution of the program), and may make the program unable to start again.
Alternatively, as described in WO-A-03038570, the agent detects any new process that is started in response to the request of execution of a program (for example, using a kernel hooking technique). The process is suspended and an authorization to run the program is requested to a metering server. If the authorization is granted, the process is resumed so as to enable the program to start. Conversely, the process is aborted thereby preventing execution of the program; this avoids killing the program while it is performing potentially risky operations.
However, none of the solutions described above can be applied to meter the usage of interpreted programs. As it is well known, an interpreted program consists of a logically sequenced series of instructions (written in a high-level language), which instructions are executed one at a time by an interpreter; the interpreted programs differ from compiled programs that are converted by a compiler into machine code being directly executable on the computer.
The interpreted programs are slower to run than compiled programs. This is due to the overhead resulting from their run-time analysis; moreover, access to variables takes longer time, because the mapping of identifiers to storage locations must be done repeatedly.
Nevertheless, the interpreted programs are particular attractive in open architectures, since they can be executed on different hardware and/or software platforms (provided that a corresponding interpreter is available). A typical example is that of applications written in the Java language, which applications are executed by a Java Virtual Machine (JVM) providing an abstract computing environment independent of the underlying platform of the computer. For this reason, the Java applications have attained a widespread diffusion in the last years (especially in the Internet).
In the above-described scenario, the licensing management systems known in the art would only detect the execution of the interpreter; conversely, no information is available about the interpreted programs that are executed by the interpreter (and that should be actually metered). This drawback prevents carrying out a full control of the programs that are running. The problem is very critical, since the interpreted programs (and particularly the Java applications) represent a large share of the market. Therefore, the economic loss suffered by the publishers may be considerable.
A possible solution could be that of exploiting profiling and/or debugging capabilities of some interpreters. For example, the Virtual Machine Profiler Interface (JVMPI) provides a two-way communication between the virtual machine and a profiler agent; particularly, the virtual machine notifies the profiler agent of various events and, vice-versa the profiler agent issues control requests to the virtual machine. In this way, the profiler interface can be used to detect the execution of any Java application by the virtual machine.
An alternative solution could be based on the Virtual Machine Debug Interface (JVMDI), which allows a debugger client to inspect and to control the state of the virtual machine. Even in this case, the debugger client can be notified of the execution of any Java application by the virtual machine.
However, those interfaces are not standard and are provided by some virtual machines only; therefore, the above-described solutions are not of general applicability. Moreover, this approach is very intrusive and interferes with the execution of the Java applications. Particularly, the profiler interface and the debug interface disable the run-time optimizations of the virtual machine; therefore, the performance of the Java applications is strongly impaired. As a consequence, the proposed solutions cannot be applied in a production environment. Moreover, the above-described technique prevents the use of the profiler interface and/or the debug interface for their real purpose (for example, to tune the Java applications).